//
//  ViewControllerEx.m
//  ASHT_IOS
//
//  Created by 宋安安 on 14-4-3.
//  Copyright (c) 2014年 宋安安. All rights reserved.
//

#import "ViewControllerEx.h"

@interface ViewControllerEx ()

@end
@implementation ViewControllerEx
@synthesize app;
@synthesize backButton;
@synthesize nav_View;
@synthesize view_Content;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        app=(AppDelegate*)[UIApplication sharedApplication].delegate;

    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
//    self.view.backgroundColor =[UIColor whiteColor];
    [self.navigationController setNavigationBarHidden:YES];
//    view_Content.backgroundColor=[UIColor blueColor];
      if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
        self.edgesForExtendedLayout = UIRectEdgeAll;
        self.extendedLayoutIncludesOpaqueBars = NO;
        self.modalPresentationCapturesStatusBarAppearance = NO;
        self.automaticallyAdjustsScrollViewInsets = NO;
        //self.view.bounds =  CGRectMake(0,-20,self.view.frame.size.width,self.view.frame.size.height);
       view_Content.frame=CGRectMake(view_Content.frame.origin.x,view_Content.frame.origin.y,view_Content.frame.size.width,view_Content.frame.size.height);
    }
    else
    {
        
    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(IBAction)leftButtonClickHandler:(id)sender
{
    [self.app.viewDeckController toggleLeftViewAnimated:YES];
}

-(IBAction)btn_back_OnClick:(id)sender
{
    [self.app.viewDeckController.navigationController popViewControllerAnimated:YES];
}
-(IBAction)RightButtonClickHandler:(id)sender
{
   [self.app.viewDeckController toggleRightViewAnimated:YES];
}
-(NSString *)ErrorMessageHandling:(NSError *)error
{
    int integer=[error code];
    NSString *message=@"";
    switch (integer) {
        case -1001:
        {
            message=@"网络连接超时。";
        }
            break;
        case -1016:
        {
            message=@"网络异常。";
        }
            break;
        case -1009:
        {
            message=@"网络已断开，请连接网络。";
        }
            break;
        default:
        {
            message=@"未知错误。";
        }
            break;
    }
    return message;
}
@end
